package de.dnb.basics.filtering;

import de.dnb.basics.applicationComponents.RangeCheckUtils;

/**
 * Filterkriterium GLEICH basierend auf equals().
 * 
 * @author Michael Inden
 * 
 * Copyright 2011 by Michael Inden 
 * 
 * @param <T>   irgendwas.
 */
public class Equals<T> implements IPredicate<T> {

	private final T acceptedValue;

	public Equals(final T acceptedValue) {
		RangeCheckUtils.assertReferenceParamNotNull("acceptedValue",
			acceptedValue);
		this.acceptedValue = acceptedValue;
	}

	@Override
	public final boolean accept(final T object) {
		return acceptedValue.equals(object);
	}
}
